'  GLOBAL.BAS  - This file contains all global constants, variables,
'and localizable strings used in the Timesheet application.
'
'

'  ***** LOCALIZABLE STRINGS *****
'
'  Strings - All message box text and titles are declared in this
'section as global constants.
'
Global Const MB_CANNOT_CREATE_OBJECT = "Cannot create Microsoft Project object.  Check that you are running Microsoft Project version 4.0 or later."
Global Const MB_PROJ_NOT_RUNNING = "Microsoft Project is not currently running.  Please start Microsoft Project and then run Timesheet."
Global Const MB_TIMESHEET = "Microsoft Project Timesheet"
Global Const MB_NO_RESOURCES = "The active project does not contain any resources.  Timesheet cannot be used with a project that does not contain resources."
Global Const MB_NO_TASKS = "The active project does not contain any tasks.  Timesheet cannot be used with a project that does not contain tasks."
Global Const MB_NO_ASSIGNED_RESOURCES = "None of the resources is assigned to a task during the specified date range."
Global Const MB_NO_OPEN_PROJECTS = "You must open a project file before using Timesheet."
Global Const MB_NO_RES_SELECTION = "You must select a resource from the Resources list."
Global Const MB_FROMDATE = "The date entered in the ""From"" field is not a valid date format."
Global Const MB_TODATE = "The date entered in the ""To"" field is not a valid date format."
Global Const MB_BAD_DATE_ORDER = "The ""From"" date must be earlier than the ""To"" date."
Global Const MB_NO_VALID_ASSIGNMENTS = "The selected resource does not have any task assignments within the specified date range."
Global Const MB_GENERIC_ERROR = "An error has occured which will force Timesheet to terminate.  Please verify that Microsoft Project is currently running, then restart Timesheet."
Global Const MB_UNRECOGNIZED_ENTRY = "Work not valid."
Global Const MB_LESS_THAN_ZERO = "You must enter a value that is greater than or equal to Zero."
Global Const MB_BAD_DATE_FORMAT = "The date you entered is not in a recognized date format."
Global Const MB_BAD_DATE_RANGE = "The specified date range is outside the dates for the active project."
Global Const MB_START_NOT_VALID = "Task start date is before the project start date."
Global Const MB_FINISH_NOT_VALID = "Task finish date is before the task start date."
Global Const MB_BAD_ASOF_DATE = "The ""As Of"" date is invalid. Make sure you have entered a valid date."
Global Const MB_PREVINSTANCE = "A copy of Microsoft Project Timesheet is already active."
Global Const MB_CONSOLIDATED_PROJECT = "The current active project is a consolidated project.  Timesheet does not support consolidated projects; please run Timesheet individually on each project."
Global Const MB_RES_SHARING = "The current active project is sharing resources from another project file.  Timesheet does not support resource-sharing projects."
Global Const MB_NO_TASK_VIEW = "Timesheet is unable to change the active view to a task view.  The active view must be a task-oriented view, such as the Gantt Chart or PERT Chart.  Please change to a task view and restart Timesheet."
Global Const MB_AUTOTRACK = "Timesheet has deselected the ""Updating Task Status Updates Resource Status"" option under the Schedule tab in the Tools, Options dialog.  If you intend to continue using Timesheet, this option should not be selected, because it may cause you to lose changes made using Timesheet."

Global Const CAP_FRM_OPTIONS = "Resource Update Options"    'Caption for frmOptions
Global Const CAP_FRM_TINFO = "Update Resource Work"         'Initial caption for frmTInfo
Global Const CAP_SPLASH1 = "Microsoft Project Timesheet"    'first line of splash screen caption
Global Const CAP_SPLASH2 = "Please wait..."                 'second line of splash screen caption

Global Const PROG_INIT = "Initializing Timesheet"
Global Const PROG_FORMLOAD = "Loading forms"
Global Const PROG_RESASSIGN = "Checking resource assignments"
Global Const PROG_DONE = "Done!"

'  Duration unit string constants.
Global Const DUR_MINUTES = "m"      ' minutes
Global Const DUR_HOURS = "h"        ' hours
Global Const DUR_DAYS = "d"         ' days
Global Const DUR_WEEKS = "w"        ' weeks
Global Const EDUR_MINUTES = "em"    ' elapsed minutes
Global Const EDUR_HOURS = "eh"      ' elapsed hours
Global Const EDUR_DAYS = "ed"       ' elapsed days
Global Const EDUR_WEEKS = "ew"      ' elapsed weeks

'  Grid column titles
Global Const GRID_TASKID = "ID"                  'Task ID
Global Const GRID_TASKNAME = "Task Name"         'Task Name
Global Const GRID_ACTWORK = "Act. Work"          'Actual Work for the resource
Global Const GRID_REMWORK = "Rem. Work"          'Remaining Work for the resource
Global Const GRID_ADDWORK = "Hours Worked"       'Additional work to apply to the task
Global Const GRID_ETC = "New Rem. Work"          'The new estimated amount of work needed to complete the task
Global Const GRID_START = "Start Date"           'Date that the resource started work on the task
Global Const GRID_FINISH = "Finish Date"         'Date that the resource finished work on the task

'  View names
Global Const GANTT_CHART = "Gantt Chart"
Global Const PERT_CHART = "PERT Chart"
Global Const TASK_SHEET = "Task Sheet"
Global Const TASK_PERT = "Task PERT"

'  ***** END LOCALIZABLE STRINGS *****

'  Global variable declarations
Global goProjApp As object          'The MSProject.Application object
Global goActiveProj As object       'The ActiveProject object
Global gdtDefStartTime As Variant   'The default start time for tasks
Global gdtDefFinishTime As Variant  'Equal to default start + default hrs. per day
Global gdtDefStartDate As Variant   'The project start date
Global gdtDefFinishDate As Variant  'The project finish date
Global gsTimeSep As String          'The time separator character.
Global gdtTodaysDate As Variant     'Today's date
Global gdtCurrentDate As Variant    'Current date from the active project
Global gdtAsOfDate As Variant       ' "As Of" date used in TInfo form
Global gbDbg As Integer             'Flag that indicates that debug info should be written to a file.  Set True with the command-line switch /d.
Global gbDbgFile As Integer         'File number of the debug file.
Global gbDTIF As Integer            'Error flag
Global gsDefWorkUnit As String      'The default work units character.
Global gsDefDurUnit As String       'The default duration units character.
Global gnDefWorkUnit As Integer     'Integer that project uses to identify the default work unit.
Global gnDefDurUnit As Integer      'Integer that project uses to identify the default duration unit.
Global gbSchedMsg As Integer        'Flag used to indicate that scheduling messages were turned off by Timesheet.
Global gsOrigView As String         'Name of the view that was originally set when TimeTrak was first run.

'  Constants used by Timesheet.

'  Microsoft Project Visual Basic constants.  These constants are in the
'same format as Proj's built-in Visual Basic for Applications constants.
'  DurationFormat constants
Global Const pjMinutes = 0
Global Const pjHours = 1
Global Const pjDays = 2
Global Const pjWeeks = 3
Global Const pjElapsedMinutes = 4
Global Const pjElapsedHours = 5
Global Const pjElapsedDays = 6
Global Const pjElapsedWeeks = 7

'  Grid fields
Global Const AUID = 0
Global Const TASKID = 1
Global Const TASKNAME = 2
Global Const ACTWORK = 3
Global Const REMWORK = 4
Global Const ADDWORK = 5
Global Const ETC = 6
Global Const START = 7
Global Const FINISH = 8

'  SetView constants
Global Const SET_VIEW = 1
Global Const RESTORE_VIEW = 2

'  FindWindow window class constant
Global Const FW_WINPROJ = "JWinproj-WhimperMainClass"

'  Resource-selection
Global Const ALL_RESOURCES = -32768

'  User-defined error codes
Global Const ERR_EMPTY_INDEX = 32767
Global Const ERR_INVALID_INDEX = 32766
Global Const ERR_NO_APP_OBJECT = 32765
Global Const ERR_NO_RES_SELECTION = 32764
Global Const ERR_BAD_PARAM = 32763
Global Const ERR_FROMDATE = 32762
Global Const ERR_TODATE = 32761
Global Const ERR_BAD_DATE_ORDER = 32760
Global Const ERR_EOL = 32759
Global Const ERR_BOL = 32758
Global Const ERR_BAD_DATE_RANGE = 32757
Global Const ERR_POOL = 32756

' Show parameters
Global Const MODAL = 1
Global Const MODELESS = 0

' Function Parameters
' MsgBox parameters
Global Const MB_OK = 0                 ' OK button only
Global Const MB_OKCANCEL = 1           ' OK and Cancel buttons
Global Const MB_ABORTRETRYIGNORE = 2   ' Abort, Retry, and Ignore buttons
Global Const MB_YESNOCANCEL = 3        ' Yes, No, and Cancel buttons
Global Const MB_YESNO = 4              ' Yes and No buttons
Global Const MB_RETRYCANCEL = 5        ' Retry and Cancel buttons

Global Const MB_ICONSTOP = 16          ' Critical message
Global Const MB_ICONQUESTION = 32      ' Warning query
Global Const MB_ICONEXCLAMATION = 48   ' Warning message
Global Const MB_ICONINFORMATION = 64   ' Information message

Global Const MB_APPLMODAL = 0          ' Application Modal Message Box
Global Const MB_DEFBUTTON1 = 0         ' First button is default
Global Const MB_DEFBUTTON2 = 256       ' Second button is default
Global Const MB_DEFBUTTON3 = 512       ' Third button is default
Global Const MB_SYSTEMMODAL = 4096      'System Modal

' MsgBox return values
Global Const IDOK = 1                  ' OK button pressed
Global Const IDCANCEL = 2              ' Cancel button pressed
Global Const IDABORT = 3               ' Abort button pressed
Global Const IDRETRY = 4               ' Retry button pressed
Global Const IDIGNORE = 5              ' Ignore button pressed
Global Const IDYES = 6                 ' Yes button pressed
Global Const IDNO = 7                  ' No button pressed

'  MousePointer
Global Const DEFAULT = 0        ' 0 - Default
Global Const HOURGLASS = 11     ' 11 - Hourglass

' Variant VarType tags
Global Const V_EMPTY = 0
Global Const V_NULL = 1
Global Const V_INTEGER = 2
Global Const V_LONG = 3
Global Const V_SINGLE = 4
Global Const V_DOUBLE = 5
Global Const V_CURRENCY = 6
Global Const V_DATE = 7
Global Const V_STRING = 8



